package org.nf.mvc.view;

import org.nf.mvc.servlet.View;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * @Author : LLH
 * @create 2021/5/28
 */
public class RedirectView extends View {

    private String url;

    public RedirectView(String url) {
        this.url = url;
    }

    /**
     * 重定向视图
     * @throws IOException
     */
    @Override
    protected void response() throws IOException {
        response.sendRedirect(url);
    }
}
